import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
// 组件
import { PageNotFoundComponent } from './page-not-found/page-not-found.component';
import { IndexComponent } from './index/index.component';
import { MapComponent } from './map/map.component';
import { PatrioticComponent } from './patriotic/patriotic.component';
import { TravelComponent } from './travel/travel.component';
import { TravelDetailComponent } from './travel-detail/travel-detail.component';

const routes: Routes = [
  { path: '', component: IndexComponent },
  { path: "map/:mapId", component: MapComponent },
  { path: "patriotic", component: PatrioticComponent },
  { path: "travel", component: TravelComponent },
  { path: "travel/:travelId", component: TravelDetailComponent },

  { path: '**', component: PageNotFoundComponent },
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }
